{% extends 'TopxiaWebBundle::layout.html.twig' %}

{% block keywords %}{{ setting('site.seo_keywords') }}{% endblock %}
{% block description %}{{ setting('site.seo_description') }}{% endblock %}

{% set bodyClass = 'homepage' %}
{% set siteNav = '/' %}
{% set script_controller = 'index' %}
{% set _target_path = path('homepage') %}

{% set currentTheme = current_theme() %}
{% set themeConfig = isEditColor|default(false) ? currentTheme.config : currentTheme.confirmConfig %}
{% set allConfig = currentTheme.allConfig %}

{% set isIndex = true %}
{% set consultDisplay = true %}

{% block full_content %}
    {% cache 'jianmo/home/top/banner' 600 %}
      {{ block_show('jianmo:home_top_banner') }}
    {% endcache %}
    {% for config in themeConfig.blocks.left|default([]) %}

      {% set code = config.code %}
      {% if config.sortName|default('') == 'recommended' and code == 'category-course' %}
        {% set code = 'recommend-course' %}
      {% endif %}

      {% set category = config.categoryId|default(0) ? data('Category', {categoryId: config.categoryId})  : null %}
      {% if code == 'friend-link' %}
         {% include 'TopxiaWebBundle:Default:' ~ code ~ '.html.twig' with {friendlyLinks:friendlyLinks} %}
      {% elseif code != 'footer-link'%}
        {% if code != 'course-grid-with-condition-index'%}
          {% cache 'jianmo/default/' ~ code 600 %}
            {% include 'TopxiaWebBundle:Default:' ~ code ~ '.html.twig' with {config:config, category: category} %}
          {% endcache %}
        {% else %}
          {% include 'TopxiaWebBundle:Default:' ~ code ~ '.html.twig' with {config:config, category: category} %}
        {% endif %}
      {% endif %}
    {% endfor %}

{% endblock %}